package com.lh.api.controller;

import com.lh.api.service.SysConfigService;
import com.lh.common.utils.Constant;
import com.lh.common.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 文件上传
 *
 * @author Mark sunlightcs@gmail.com
 */
@RestController
@RequestMapping("/api/sys")
@Api(value="UploadController",tags={"文件上传"})
public class UploadController {

	@Autowired
	private SysConfigService sysConfigService;

	/**
	 * @Title: getUploadUrl
	 * @Description: 获取上传url与key(这里用一句话描述这个方法的作用)
	 * @throws
	 */
	@ApiOperation(value = "获取上传文件路径")
	@ApiImplicitParams({

	})
	@GetMapping("/getUploadFileUrl")
	@ResponseBody
	public Result<String> getUploadFileUrl() {
		String url = sysConfigService.getValue(Constant.OSS_URL);
		return Result.ok(url);
	}


}
